﻿using System.ComponentModel.DataAnnotations;
using YWM.Dto;

namespace PLC.Interface.BaseUsers
{
    public class UserPasswordDto : EntityDto
    {
        [Required(ErrorMessage = "旧密码不能为空"), RegularExpression(@"^[a-zA-Z0-9]{6,12}$", ErrorMessage = "旧密码必须是6到12个字母或数字")]
        public string OldPassword { get; set; }

        [Required(ErrorMessage = "新密码不能为空"), RegularExpression(@"^[a-zA-Z0-9]{6,12}$", ErrorMessage = "新密码必须是6到12个字母或数字")]
        public string NewPassword { get; set; }

        [Required(ErrorMessage = "确认密码不能为空"), Compare(nameof(NewPassword), ErrorMessage = "确认密码与新密码不一致")]
        public string ConfirmPassword { get; set; }
    }
}
